package com.google.zxing.oned;

public final class CodaBarWriter extends OneDimensionalCodeWriter
{
  private static final char[] ALT_START_END_CHARS = { 84, 78, 42, 69 };
  private static final char[] CHARS_WHICH_ARE_TEN_LENGTH_EACH_AFTER_DECODED = { 47, 58, 43, 46 };
  private static final char DEFAULT_GUARD = START_END_CHARS[0];
  private static final char[] START_END_CHARS = { 65, 66, 67, 68 };

  public boolean[] encode(String paramString)
  {
    int j;
    int k;
    if (paramString.length() < 2)
    {
      paramString = DEFAULT_GUARD + paramString + DEFAULT_GUARD;
      j = 20;
      k = 1;
      label42: if (k >= -1 + paramString.length())
        break label359;
      if ((!Character.isDigit(paramString.charAt(k))) && (paramString.charAt(k) != '-') && (paramString.charAt(k) != '$'))
        break label301;
      j += 9;
    }
    while (true)
    {
      k++;
      break label42;
      char c1 = Character.toUpperCase(paramString.charAt(0));
      int i = -1 + paramString.length();
      char c2 = Character.toUpperCase(paramString.charAt(i));
      boolean bool1 = CodaBarReader.arrayContains(START_END_CHARS, c1);
      boolean bool2 = CodaBarReader.arrayContains(START_END_CHARS, c2);
      boolean bool3 = CodaBarReader.arrayContains(ALT_START_END_CHARS, c1);
      boolean bool4 = CodaBarReader.arrayContains(ALT_START_END_CHARS, c2);
      if (bool1)
      {
        if (bool2)
          break;
        throw new IllegalArgumentException("Invalid start/end guards: " + paramString);
      }
      if (bool3)
      {
        if (bool4)
          break;
        throw new IllegalArgumentException("Invalid start/end guards: " + paramString);
      }
      if ((bool2) || (bool4))
        throw new IllegalArgumentException("Invalid start/end guards: " + paramString);
      paramString = DEFAULT_GUARD + paramString + DEFAULT_GUARD;
      break;
      label301: if (!CodaBarReader.arrayContains(CHARS_WHICH_ARE_TEN_LENGTH_EACH_AFTER_DECODED, paramString.charAt(k)))
        break label322;
      j += 10;
    }
    label322: throw new IllegalArgumentException("Cannot encode : '" + paramString.charAt(k) + '\'');
    label359: boolean[] arrayOfBoolean = new boolean[j + (-1 + paramString.length())];
    int m = 0;
    for (int n = 0; n < paramString.length(); n++)
    {
      int i1 = Character.toUpperCase(paramString.charAt(n));
      if ((n == 0) || (n == -1 + paramString.length()));
      int i2;
      label463: int i4;
      int i5;
      int i6;
      int i7;
      switch (i1)
      {
      default:
        i2 = 0;
        int i3 = CodaBarReader.ALPHABET.length;
        i4 = 0;
        if (i2 < i3)
        {
          if (i1 == CodaBarReader.ALPHABET[i2])
            i4 = CodaBarReader.CHARACTER_ENCODINGS[i2];
        }
        else
        {
          i5 = 1;
          i6 = 0;
          i7 = 0;
        }
        break;
      case 84:
      case 78:
      case 42:
      case 69:
      }
      while (true)
      {
        label507: if (i7 >= 7)
          break label606;
        arrayOfBoolean[m] = i5;
        m++;
        if (((0x1 & i4 >> 6 - i7) == 0) || (i6 == 1))
        {
          if (i5 == 0);
          for (i5 = 1; ; i5 = 0)
          {
            i7++;
            i6 = 0;
            break label507;
            i1 = 65;
            break;
            i1 = 66;
            break;
            i1 = 67;
            break;
            i1 = 68;
            break;
            i2++;
            break label463;
          }
        }
        i6++;
      }
      label606: if (n < -1 + paramString.length())
      {
        arrayOfBoolean[m] = false;
        m++;
      }
    }
    return arrayOfBoolean;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.google.zxing.oned.CodaBarWriter
 * JD-Core Version:    0.6.2
 */